<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" template="/mainTemplate.xhtml">

    <ui:define name="content">
        <h:form id="ordersForm">

            <p:toolbar id="ordersToolbar" style="margin-top:20px; margin-bottom:5px">
                <p:toolbarGroup align="left">
                    <p:commandButton value="Добавить"
                                     action="#{ordersBean.addOrder()}" style="font-size: 85% !important"/>
                    <p:commandButton value="Редактировать"
                                     action="#{ordersBean.editOrder()}" style="font-size: 85% !important"/>
                    <p:commandButton value="Удалить"
                                     action="#{ordersBean.deleteOrder()}" style="font-size: 85% !important"/>
                </p:toolbarGroup>
            </p:toolbar>

            <p:dataTable id="ordersTable" var="order" value="#{ordersBean.ordersList}"
                         rowKey="#{order.name}" selection="#{ordersBean.order}"
                         selectionMode="single">

                <p:column headerText="Название">
                    <h:outputText value="#{order.name}" />
                </p:column>

                <p:column headerText="Заказчик">
                    <h:outputText value="#{projectBean.getCustomer(project_id)}" />
                </p:column>

                <p:column headerText="Дата начала строительства">
                    <h:outputText value="#{projectBean.getProjectStartDate(project.id)}" />
                </p:column>

                <p:column headerText="Стоимость заказа">
                    <h:outputText value="#{projectBean.getProjectTotal(project_id)}" />
                </p:column>

            </p:dataTable>

        </h:form>

    </ui:define>
</ui:composition>